<?php

// the facebook client library
include_once 'facebook.php';

// some basic library functions
include_once 'lib.php';

// this defines some of your basic setup
include_once 'config.php';

	// your callback url
    $appcallbackurl = 'http://eparinay.com/social_apps/facebook/hot_gallery/';
    // your facebook url of this page
    $inviteurl = 'http://apps.facebook.com/hot_gallery/index.php';
	

$facebook = new Facebook($api_key, $secret);
$facebook->require_frame();
$user = $facebook->require_login();
$facebook->require_install();

//catch the exception that gets thrown if the cookie has an invalid session_key in it
    try {
    if (!$facebook->api_client->users_isAppAdded()) {
    $facebook->redirect($facebook->get_add_url());
    }
    } catch (Exception $ex) {
    //this will clear cookies for your application and redirect them to a login prompt
    $facebook->set_user(null, null);
    $facebook->redirect($appcallbackurl);
    }
////////////////////////////////////////////////////////



?>



<div style="border:3px #ccc solid;padding:5px;">
<fb:dashboard>
    <fb:action href=".">Add Something</fb:action>
    <fb:action href=".">Delete Something</fb:action>
    <fb:action href="minifeedcode.php?public=y">Add to minifeed</fb:action>
    <fb:help href="help.php">Help me</fb:help>
    <fb:create-button href=".">Add Hot Gallery</fb:create-button>
</fb:dashboard>
</div>

<div style="border:3px #ccc solid;padding:5px;">
<fb:tabs>
	<fb:tab_item href="invite_friend_on_facebook.php" title="Invite Your Friends" />
    <fb:tab_item href="invite.php" title="All Invite Your Friends" />
    <fb:tab_item href="add_to_profile.php" title="Add to profile Default fbml" />  
    <fb:tab_item href="Invite_friend_sample/index.php" title="Another Invite Friend" />
</fb:tabs>
</div>

<div style="border:3px #ccc solid;padding:5px;">
<fb:dialog id="fb_test">
    <fb:dialog-title>This is a test</fb:dialog-title>
    <fb:dialog-content>Content</fb:dialog-content>
    <fb:dialog-button type="button" value="Okay" close_dialog="1" />
</fb:dialog>
<a href="" clicktoshowdialog="fb_test">show fb:dialog</a>
</div>

<div style="border:3px #ccc solid;padding:5px;">
<b>For example, take this snippet that generates a search form to search Facebook (or some
other site):</b><br />
<fb:dialog id="fb_search" cancel_button="true">
    <fb:dialog-title>Search Facebook</fb:dialog-title>
    <fb:dialog-content>
        <form action="http://www.facebook.com/s.php" method="get">
            <input type="text" name="q" />
            <input type="submit" value="Search" />
        </form>
    </fb:dialog-content>
</fb:dialog>
<a href="" clicktoshowdialog="fb_search">Show Search</a>
</div>

<div style="border:3px #ccc solid;padding:5px;">
javacript sample code in facebook <br />
<a href="#" id="hello" onclick="hello_world(this); return false;">Hello World!</a>
<script>
<!--
function random_int(lo, hi) {
    return Math.floor((Math.random() * (hi - lo)) + lo);
}
function hello_world(obj) {
    var r = random_int(0, 255);
    var b = random_int(0, 255);
    var g = random_int(0, 255);
    var color = r+', '+g+', '+b;
    obj.setStyle('color', 'rgb('+color+')');
}
hello_world(document.getElementById('hello'));
//-->
</script>
</div>

<div style="padding: 10px;">
	<fb:dashboard>	
    <fb:help href="help.php">Application Help</fb:help>
	</fb:dashboard>
	<br /><br />
  <h2>Hi <fb:name firstnameonly="true" uid="<?=$user?>" useyou="false"/>!</h2><br/>
  <a href="<?= $facebook->get_add_url() ?>">Put Hot gallery in your profile</a>, if you haven't already!
    <form method="post" >
<?php
      if ($prints_id != $user) {
        echo 'Do you want to step on <fb:name uid="' . $prints_id . '"/>?';
        echo '<input type="hidden" name="to" value="' . $prints_id . '"/>';
      } else {
        echo '<br/>Step on a friend:';
        echo '<fb:friend-selector idname="to"/>';
      }
?>
      <input value="step" type="submit"/>
    </form>
  <hr/>
  These are <fb:name uid="<?= $prints_id ?>" possessive="true"/> Hot Gallery:<br/>
  <?php echo render_prints($prints, 10); ?>
  <div style="clear: both;"/>
</div>

<div style="border:3px #ccc solid;padding:5px;">
<fb:profile-pic uid="<?php echo($user)?>" />

</div>

<div style="border:3px #ccc solid;padding:5px;">
<a href="http://media.photobucket.com/image/sexy%20girl%20and%20boy/ashleighmurray08/Boy%20and%20Girl/sexy.jpg?o=1" target="_blank"><img src="http://i281.photobucket.com/albums/kk203/ashleighmurray08/Boy%20and%20Girl/sexy.jpg"></a>
<a href="http://apps.facebook.com/hot_gallery/" target="_self"><img src="http://i273.photobucket.com/albums/jj209/heads_and_bonds/Feelings/SEXY.jpg"></a>
<a href="http://media.photobucket.com/image/sexy/peypeylolgurl/Sexy.jpg?o=1" target="_blank"><img src="http://i327.photobucket.com/albums/k442/peypeylolgurl/Sexy.jpg"></a>
<a href="http://photobucket.com/group/image/sexy/5STJPIRCWJ/sexy.jpg?o=13" target="_blank"><img src="http://gi266.photobucket.com/groups/ii243/5STJPIRCWJ/sexy.jpg"></a>


</div>

